﻿@model KimPhongCRM.Models.tblKhachHang
@{
    ViewBag.Title = "Create";
    
@*Get userid*@
    var uid = KimPhongCRM.Lib.SessionData.GetSession("sdUserId").ToString();
    Guid? user_id;
    if (uid != "")
    {
        user_id = new Guid(KimPhongCRM.Lib.SessionData.GetSession("sdUserId").ToString());
    }
    else
    {
        KimPhongCRM.Controllers.BaseController bcontrol = new KimPhongCRM.Controllers.BaseController();
        string un = User.Identity.Name;
        bcontrol.ressUserID(un);
        user_id = new Guid(KimPhongCRM.Lib.SessionData.GetSession("sdUserId").ToString());
    }
@*Get userid*@
    var listUser = ViewData["listUser"] as List<KimPhongCRM.Models.sp_Select_Combobox_User_Result>;
}


<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

<div class="row-fluid sortable ui-sortable">
    <div class="box span12">
        <div class="box-header" data-original-title="">
            <h2><i class="icon-edit"></i><span class="break"></span>Thêm khách hàng mới</h2>
            <div class="box-icon">
                <a href="#" class="btn-setting"><i class="icon-wrench"></i></a>
                <a href="#" class="btn-minimize"><i class="icon-chevron-up"></i></a>
                <a href="#" class="btn-close"><i class="icon-remove"></i></a>
            </div>
        </div>
        <div class="box-content">
            @using (Html.BeginForm())
            {
                Html.ValidationSummary(true);
                <fieldset>
                    <div class="control-group">
                        <label class="control-label">Họ khách hàng</label>
                        <div class="controls">
                            @Html.TextBoxFor(model => model.hoKH, new { @class = "ui", id = "inputError" })
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Tên khách hàng</label>
                        <div class="controls">
                            @Html.TextBoxFor(model => model.tenKH, new { @class = "ui", id = "inputError" })
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Địa chỉ</label>
                        <div class="controls">
                            @Html.TextBoxFor(model => model.diaChiKH, new { @class = "ui", id = "inputError" })

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Số điện thoại</label>
                        <div class="controls">
                            @Html.TextBoxFor(model => model.sdtKH, new { @class = "ui", id = "inputError" })
                        </div>
                    </div>

                    @Html.Hidden("alertBirthDay", -1)

                    @Html.Hidden("nguoiNhap", @user_id)

                    @Html.Hidden("ngayNhap", @DateTime.Now)

                    @Html.Hidden("nguoiSuaCuoi", @user_id)

                    @Html.Hidden("ngaySuaCuoi", DateTime.Now)

                    <div class="control-group">
                        <label class="control-label">Ngày sinh</label>
                        <div class="controls">
                            @Html.EditorFor(model => model.sinhNhatKH)
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Kinh độ</label>
                        <div class="controls">
                            @Html.TextBoxFor(model => model.kinhDoKH, new { @class = "ui", id = "inputError" })
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Vĩ độ</label>
                        <div class="controls">
                            @Html.TextBoxFor(model => model.viDoKH, new { @class = "ui", id = "inputError" })
                        </div>
                    </div>

                    <div class="control-group">
                        @Html.CheckBoxFor(model => model.isActive)
                        @Html.LabelFor(model => model.isActive, "Active")
                    </div>

                    <div class="form-actions">
                        <button type="submit" class="ui btn btn-primary">Lưu thông tin</button>
                    </div>
                </fieldset>
            }
        </div>
    </div>
    <!--/span-->

</div>
